package com.study.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.bean.Student;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author mengxj
 */
public interface StudentMapper extends BaseMapper<Student> {

    List<String> studentNames();

    @Select("select name from t_student")
    List<String> studentNames1();

    /**
     * 如何通过sql 直接获取对象
     */
    List<Student> studentMyself(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);

    List<Student> selectAll();

    List<Student> selectMybatisPlus(Page<Student> page, @Param("ew") QueryWrapper<Student> wrapper);

    IPage<Student> selectMybatisPlus1(Page<Student> page, @Param("ew") QueryWrapper<Student> wrapper);

    List<Student> studentList(@Param("age") Integer age, @Param("address") String address, @Param("column") String column);

    List<Student> selectStudent(@Param("names") List<String> names, @Param("type") Integer type);
}
